<template>
  <div class="detailBox">
    <div class="detailCon">
      <div class="basicBox" v-show="!fullLoading">
        <div class="top">
          <div class="tit">
            <b>
              {{ detailInfo.activeName }}
            </b>
          </div>
        </div>
        <div class="middle">
          <p>
            <label>活动时间</label>
            <span>{{ detailInfo.activeTime }}</span>
          </p>
          <p>
            <label>活动地点</label>
            <span>{{ detailInfo.activeAddr }}</span>
          </p>
          <p>
            <label>活动人数</label>
            <span>{{ detailInfo.activePeropleNumer }}</span>
          </p>
        </div>
        <!-- <div class="bottom">
          <p>
            <label>活动措施</label>
            <span style="overflow: unset">{{
              (detailInfo.fvaccDate || "~ ") +
              "/" +
              (detailInfo.svaccDate || " ~ ") +
              "/" +
              (detailInfo.tvaccDate || " ~")
            }}</span>
          </p>
        </div> -->
      </div>
      
      <div class="followerBox">
        <h5 @click="isFold = !isFold">
          <b>活动措施</b>
          <p v-if="isFold">展开 <van-icon name="arrow-down" /></p>
          <p v-else>折叠 <van-icon name="arrow-up" /></p>
        </h5>
        <div v-show="!isFold" class="list">
          <div
            v-for="(val, ind) in fileList"
            :key="ind"
            class="list-item"
          >
            <div v-for="v in fileList" :key="v.title" class="fileBox">
                <div v-if="v.value && v.value.length">
                    <p class="van-cell-p">{{v.title}}</p>
                    <div class="file-list">
                        <uploadCom :readOnly="true" :defaultFiles="v.value"></uploadCom>
                    </div>
                </div>
                <van-cell v-else :title="v.title" value="暂无" />
            </div>
          </div>
          <!-- <van-empty
            v-if="!nucleinAcidData.length"
            class="custom-image"
            :image="require('../../../../assets/images/empty.png')"
            description="暂无核酸检测信息"
          /> -->
        </div>
      </div>
      <div class="followerBox">
        <h5 @click="isUserFold = !isUserFold">
          <b>活动人员</b>
          <p v-if="isUserFold">展开 <van-icon name="arrow-down" /></p>
          <p v-else>折叠 <van-icon name="arrow-up" /></p>
        </h5>
        <div v-show="!isUserFold" class="list">
          <div
            v-for="(val, ind) in userfileList"
            :key="ind"
            class="list-item"
          >
            <div v-for="v in userfileList" :key="v.title" class="fileBox">
                <div v-if="v.value && v.value.length">
                    <p class="van-cell-p">{{v.title}}</p>
                    <div class="file-list">
                        <uploadCom :readOnly="true" :defaultFiles="v.value"></uploadCom>
                    </div>
                </div>
                <van-cell v-else :title="v.title" value="暂无" />
            </div>
          </div>
          <!-- <van-empty
            v-if="!nucleinAcidData.length"
            class="custom-image"
            :image="require('../../../../assets/images/empty.png')"
            description="暂无核酸检测信息"
          /> -->
        </div>
      </div>
    </div>
    <full-loading v-if="fullLoading"></full-loading>
  </div>
</template>

<script>
export default {
  data() {
    return {
      fullLoading: false,
      isFold: true,
      isUserFold: true,
      detailInfo: [],
      fileList: [],
      userfileList: [],
    };
  },
  methods: {
    // 获取详情数据
    getData(arr = []) {
      this.detailInfo = arr;
    },
    // 获取附件数据
    getFileData(arr = []) {
      this.fileList = arr;
    },
    // 获取附件数据
    getUserFileData(arr = []) {
      this.userfileList = arr;
    },
  },
};
</script>

<style scoped lang="less">
.detailBox {
  background: rgb(238, 238, 238);
  height: 100%;
  overflow: auto;
}
.detailCon {
  padding: 12px;
  box-sizing: border-box;
}
.basicBox {
  padding: 30px 10px 10px;
  box-sizing: border-box;
  align-items: center;
  background: #fff;
  border-radius: 8px;
  margin: 1px 0 8px 0;
  position: relative;
  .top {
    border-bottom: 1px dashed #aaa;
    padding: 0 5px 10px;
    margin-bottom: 12px;
    position: relative;
    line-height: 22px;
    .tit {
      b {
        font-size: 16px;
        span {
          font-size: 14px;
        }
      }
      .type {
        background: #f2a84e;
        font-size: 9px;
        color: #fff;
        margin-left: 8px;
        padding: 2px 3px;
        border-radius: 3px;
      }
    }
    .row {
      color: #999;
      font-size: 13px;
    }
    .status {
      position: absolute;
      top: 0;
      right: 0;
      span {
        color: #bbb;
        font-size: 13px;
      }
      img {
        width: 35px;
        height: 35px;
        margin-right: 10px;
      }
    }
  }
  .middle {
    padding: 0 5px 10px;
    box-sizing: border-box;
    border-bottom: 1px dashed #aaa;
  }
  p {
    display: flex;
    line-height: 28px;
    label {
      width: 2.2rem;
      color: #999;
    }
    span {
      color: #333;
      flex: 1;
      overflow: hidden;
      white-space: nowrap;
      text-overflow: ellipsis;
    }
  }
  .bottom {
    padding: 0 5px;
    box-sizing: border-box;
    margin-top: 10px;
    p span,
    p label {
      color: #999;
    }
  }
  .imgBox {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    padding: 2px;
    box-sizing: border-box;
    position: absolute;
    top: -35px;
    left: 50%;
    transform: translateX(-50%);
    background: #fff;
    overflow: hidden;
    img {
      width: 100%;
      height: 100%;
      border-radius: 50%;
    }
  }
}
h5 {
  border-bottom: 1px solid #f1f1f2;
  line-height: 40px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 15px;
  font-weight: normal;
  position: relative;
  b {
    font-size: 14px;
  }
  p {
    font-weight: normal;
    position: absolute;
    color: #888;
    right: 15px;
  }
}
.followerBox {
  background: #fff;
  border-radius: 8px;
  margin-top: 12px;
  /deep/.van-empty {
    padding: 20px 0;
    .van-empty__image {
      width: 50px;
      height: 50px;
    }
  }
  .list-item {
    display: flex;
    padding: 10px;
    box-sizing: border-box;
    align-items: center;
    img {
      width: 60px;
      height: 60px;
      margin-right: 10px;
    }
    .right {
      flex: 1;
      overflow: hidden;
      border-bottom: 1px solid #f1f1f2;
      div {
        display: flex;
        line-height: 28px;
        label {
          width: 75px;
          color: #999;
          padding: 0px 38px 0px 5px;
        }
        p {
          color: #333;
          flex: 1;
          overflow: hidden;
          text-overflow: ellipsis;
          white-space: nowrap;
        }
      }
    }
  }
}
</style>
